package com.cg.controller;


import com.cg.dto.AddQuestionDTO;
import com.cg.dto.StartQuizDTO;
import com.cg.dto.UpdateQuestionDTO;
import com.cg.entity.Question;
import com.cg.result.R;
import com.cg.service.IQuizService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@CrossOrigin
@Api(value = "quizController",description = "欢迎来到答题管理",tags = "答题管理")
@RequestMapping("/api/quiz")
public class QuizController {
    @Autowired
    private IQuizService quizService;

    @PostMapping("startQuiz")
    @ApiOperation("开始答题")
    public R startQuiz(@Validated @RequestBody StartQuizDTO startQuizDTO){
        return quizService.startQuiz(startQuizDTO);
    }


}
